<%@ page import="com.ciquan.server.util.web.BasePathUtil" %>
<%--
  Created by IntelliJ IDEA.
  User: kakalee
  Date: 15/1/24
  Time: 14:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="header.jsp"></jsp:include>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <a href="/advertisement/add" style="display: block; float: right; margin-bottom: 10px"><button class="btn btn-info">添加广告</button></a>
    <table class="table table-bordered table-hover">
        <thead>
            <tr>
                <th>ID</th>
                <th>标题</th>
                <th>地址</th>
                <th>图片</th>
                <th>类型</th>
                <th>管理</th>
            </tr>
        </thead>
        <tbody>
            <c:forEach items="${advertisements}" var="advertisement">
                <tr>
                    <td>${advertisement.id}</td>
                    <td>${advertisement.title}</td>
                    <td>${advertisement.url}</td>
                    <td>${advertisement.image}</td>
                    <td>
                        <c:if test="${advertisement.type == 0}">
                            焦点图
                        </c:if>
                        <c:if test="${advertisement.type == 1}">
                            启动图
                        </c:if>
                    </td>
                    <td><a href="/advertisement/edit?id=${advertisement.id}">修改</a></td>
                </tr>
            </c:forEach>
        </tbody>
    </table>
</div>

</div>
</body>
</html>
